
/*
 * EECS285
 * Project 4- Game GUI
 * Anup Jadhav
 */

package com.odyssey.main;

import com.odyssey.R;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;

public class GuiActivity extends Activity implements OnClickListener {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        //button listeners
        View newButton = findViewById(R.id.new_button);
		newButton.setOnClickListener(this);
        View aboutButton = findViewById(R.id.about_button);
        aboutButton.setOnClickListener(this);
        View exitButton = findViewById(R.id.exit_button);
        exitButton.setOnClickListener(this);
    }
    
    public void onClick(View inView)
    {
    	//depending on what button was clicked, perform appropriate action
      switch(inView.getId())
      {
      	//go to base game activity
      	case R.id.new_button:
      		Intent z = new Intent(this, com.odyssey.main.SampleGameActivity.class);
      		startActivity(z);
      		break;
      
      	//open about dialog
        case R.id.about_button:
        	Intent a = new Intent(this, AboutActivity.class);
        	startActivity(a);
        	break;
        
        //exit
        case R.id.exit_button:
        	finish();
        	break;
 
      }
    }
}